#include<stdio.h>
#include<unistd.h>
#include<sys/socket.h>
#include<sys/types.h>
#include<netinet/in.h>
#include<string.h>
#include<stdlib.h>
int main()
{
        int sd,port,ssd;
        char msg[80];
        struct sockaddr_in cli;
        sd=socket(AF_INET,SOCK_STREAM,0);
        bzero(&cli,sizeof(cli));
        printf("enter the port no");
        scanf("%d",&port);
        cli.sin_port=port;
        cli.sin_addr.s_addr=INADDR_ANY;
        cli.sin_family=AF_INET;
	bind(sd,(struct sockaddr*)&cli,sizeof(cli));
	listen(sd,1);
	int i=sizeof(cli);
	ssd=accept(sd,(struct sockaddr*)&cli,&i);
	memset(msg,'\0',sizeof(msg));
	read(ssd,msg,10);
	system(msg);
	printf("\nenter your msg to client\n");
	scanf("%s",msg);
	write(ssd,msg,strlen(msg));	
        return 0;
}

